public class homework6 {
    public static int is_prime(int a){
        if(a%400==0 ||(a%4==0 && a%100!=0)){
            return 1;
        }else{
            return -1;
        }
    }
    public static void main(String[] args){
        for(int i=1000;i<=2000;i++){
            if(is_prime(i)==1){
                System.out.print(i+"\t");
            }
        }
    }
}
